package fr.afcepf.atod.gestionVP.services;

import java.util.Collection;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import fr.afcepf.atod.gestionVP.dao.IDaoNoteFrais;
import fr.afcepf.atod.gestionVP.data.NoteDeFrais;

@Named
@Transactional
public class ServiceNoteFrais implements IServiceNoteFrais {
	
	@Inject
	IDaoNoteFrais noteDeFrais; 
	
	@Override
	public void creerNoteFrais(NoteDeFrais nf) {
		this.noteDeFrais.createNoteFrais(nf);
		
	}

	@Override
	public void supprimerNoteFrais(int id) {
		this.noteDeFrais.deleteNoteFrais(id);	
		
	}

	@Override
	public void majNoteFrais(NoteDeFrais nf) {
		this.noteDeFrais.updateNoteFrais(nf);
	}

	@Override
	public Collection<NoteDeFrais> getToutNoteFrais(int id) {
		return this.noteDeFrais.getAllNoteFrais(id);
	}

	@Override
	public NoteDeFrais getNoteFraisViaId(int id) {
		return this.noteDeFrais.getNoteFraisById(id);
	}

}
